class Person {
    public name: string
    public age: number
    private aihao: string

    constructor(name: string, age: number, aihao: string) {
        this.name = name
        this.age = age
        this.aihao = aihao
    }

    private eating() { // 私有的只有类内部才能访问
        console.log(this.name + '在吃饭');
    }

    protected swim() {// 只能在自己的类和子类才能访问
        console.log('swim')
    }

}


class Student extends Person {
    constructor(name: string, age: number, aihao: string) {
        super(name, age, aihao)
        console.log(this.swim());
    }
}

const p = new Person('lyy', 123, '213')

console.log(p.name, p.age);

export { }